import { Controller } from './decorator'
import {IRequestOption} from '../type'

const fnDebugLog = require('debug')('controller')

@Controller('users')
export class UserController {
  getAll (option:IRequestOption) {
    fnDebugLog(`User::getAll) - ${(this as any).root}`, option)
    return [
      { name: 'Tom',    age: '12'},
      { name: 'Jerry',  age: '11'},
    ]
  }
}

@Controller('teachers')
export class TeacherController {
  getAll (option:IRequestOption) {
    fnDebugLog(`Teacher::getAll) - ${(this as any).root}`, option)
    return [
      { name: 'Mary', age: '32'},
      { name: 'Max',  age: '41'},
    ]
  }
}
